<?php 
include("../inc/conn.inc");
//三帝币
$sys=1;
if($_POST[jifen]){
   $j_url=$_SERVER['HTTP_REFERER'];
   $j_rs=@mysql_query("select id,m_jifen from member where id='".$_COOKIE['user_id']."'");
   $j_row=@mysql_fetch_array($j_rs);
   
   $j_rs2=@mysql_query("select id from jifen where member_id='".$_COOKIE['user_id']."' and j_type='1' and j_url='$j_url'");
   $j_row2=@mysql_fetch_array($j_rs2);
   if($j_row2[id]){
      $sys=1;
   }else{
      if($j_row[m_jifen]<2){
         echo "<script>alert('您的三帝币余额不足，请充值');location='$j_url'</script>";
      }else{
	     $j_number=$j_row[m_jifen]-2;
		 @mysql_query("update member set m_jifen='$j_number' where id='".$_COOKIE['user_id']."'");
		 @mysql_query("insert into jifen (member_id,j_type,j_num,j_name,add_time,j_url) values ($_COOKIE[user_id],'1','2','浏览买家信息','".date("Y-m-d H:i:s")."','$j_url')");
         $sys=1;
      }
   }
}
$rs=@mysql_query("select id,member_id,b_title,picture from buy where id='".$_GET['id']."'");
$row=@mysql_fetch_array($rs);
$m_rs=@mysql_query("select id,m_type,m_user,m_name,m_cname,m_sex,c_type,c_mode,m_ts_tel,m_pic from member where id='".$row['member_id']."'");
$m_row=@mysql_fetch_array($m_rs);
if($m_row['m_type']==6){
   $m_url="http://$m_row[m_user].sandib2b.cn";
   $m_url2="http://$m_row[m_user].sandib2b.cn/contact.htm";
   $m_url3="http://$m_row[m_user].sandib2b.cn/company.htm";
   $m_url4="http://$m_row[m_user].sandib2b.cn/product-list/1.htm";
}else{
   $m_url="/cn/template/$m_row[m_user]/";
   $m_url2="/cn/template/$m_row[m_user]/contact.html";
   $m_url3="/cn/template/$m_row[m_user]/company.html";
   $m_url4="/cn/template/$m_row[m_user]//product-list/1.html";
}
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>求购-<?=$row[b_title]?>-图片展示</title>
<link href="/css/body.css" rel="stylesheet" type="text/css" />
<link href="/css/link.css" rel="stylesheet" type="text/css" />
<link href="/css/head_1.css" rel="stylesheet" type="text/css" />
<link href="/css/foot.css" rel="stylesheet" type="text/css" />
<link href="/Buy/css/content.css" rel="stylesheet" type="text/css" />
<style type="text/css">
<!--
#Layer1 {
	height: 230px;
	width: 260px;
	position: absolute;
	top: 224px;
}
-->
</style>
</head>
<body>
<?php include("../inc/head_top.php")?>
<div class="top1">
<div style="float:left;width:388px;"><a href="/"><img src="/images/logo.gif" alt="三帝贸易网" border="0"/></a></div>

<div class="top2menu">
<a href="/">三帝首页</a>
<a href="/supply">供应</a>
<a href="/buy" class="hover">求购</a>
<a href="/company">公司库</a>
<div class="onl"></div>
</div>
<div class="top2search">
<form method="get" action="/buy/search.php" onsubmit="return buysearch()">
 <ul>
<li style="padding-top:1px;width:20px;">
</li>
<li><input name="subject" id="subject" type="text" class="input" /></li>
<li style="padding-top:1px;"><input type="image"  src="/images/3.gif"  />
</li>
</ul>
  </form>
<div class="onl"></div>
</div>
<script language="javascript">
function $(id){
return document.getElementById(id);
}
function buysearch(){
if($("subject").value==""){
alert("请输入产品名称");
$("subject").focus();
return false;
}
}
</script>
<div class="onl"></div>
</div>
<div class="onl"></div>
<div id="mian" class="topside6 side">
<div class="title1"><a href="/buy/<?=$row['id']?>.html"> &lt;&lt; 返回 <?=$row[b_title]?></a></div>
<div class="onl"></div>
</div>

<div class="w960 topside20 side">
<script type="text/javascript">/*960*90，创建于2011-3-9*/ var cpro_id = 'u403357';</script><script src="http://cpro.baidu.com/cpro/ui/c.js" type="text/javascript"></script>
<div class="onl"></div>
</div>

<div id="mian" class="topside6 sideblue">
<div class="title4 size14 b fontwhite"><?=$row[b_title]?></div>
<div class="leftmain topside6">
<div align="center" style="margin:20px;"><script type="text/javascript"><!--
google_ad_client = "pub-2924453545159453";
/* 468x60, 创建于 11-3-18 */
google_ad_slot = "2442297650";
google_ad_width = 468;
google_ad_height = 60;
//-->
</script>
<script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script></div>
<div align="center"><input type="button" value="放大" onClick="imgToSize(1);">
      <input type="button" value="缩小" onClick="imgToSize(0);">
      <input type="button" value="翻转90°" onClick="imgRoll();">
      <input type="button" value="水平翻转" onClick="imgReverse('H');"> 
      <input type="button" value="垂直翻转" onClick="imgReverse('V');"></div>
<div align="center" style="height:400px;">
<?php if($row[picture]){?><img id="oImg" src="http://img.sandib2b.cn/<?=$row[picture]?>" style="position:relative; zoom:100%;  cursor:move;" onMouseDown="mStart();" onMouseUp="mEnd();"><?php }else{?><img src="http://img.sandib2b.cn/NoPICB.gif" border="0" /><?php }?>
</div>
<div align="center" style="margin:20px;"><script type="text/javascript"><!--
google_ad_client = "pub-2924453545159453";
/* 468x60, 创建于 11-3-18 */
google_ad_slot = "2442297650";
google_ad_width = 468;
google_ad_height = 60;
//-->
</script>
<script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script></div>
<div class="onl"></div>
</div>
<?php if($_COOKIE[user_id]||!$_COOKIE[user_id]){
      $mrs=mysql_query("select m_type,m_user,m_jifen from member where id='".$_COOKIE['user_id']."'");
	  $mrow=mysql_fetch_array($mrs);
?>
         <?php if($mrow[m_type]==6||$sys==1){?>
               <div class="rightmain topside6 rightside6 downside6">
                  <ul class="companyinfo">
                       <li><span class="size18 fontblue"><?=$m_row['m_cname']?></span></li>
                       <li class="topside6">&nbsp;&nbsp;<a href="<?=$m_url?>" target="_blank"><img src="/images/home.gif" alt="<?=$m_row['m_cname']?>" width="104" height="29" border="0" /></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a href="<?=$m_url2?>" target="_blank"><img src="/images/contact.gif" alt="联系方式-<?=$m_row['m_cname']?>" width="104" height="29" border="0" /></a></li>
                       <li>&nbsp;&nbsp;&nbsp;&nbsp;<a href="<?=$m_url3?>" target="_blank">公司介绍</a>&nbsp;&nbsp;&nbsp;&nbsp;<a href="<?=$m_url4?>" target="_blank">公司产品</a></li>
                       <li>&nbsp;&nbsp;&nbsp;&nbsp;联系人：<?=$m_row[m_name]?>[<?=$m_row[m_sex]?>]</li>
                       <li>&nbsp;&nbsp;&nbsp;&nbsp;企业类型：<?=$m_row['c_mode']?></li>
                       <li>&nbsp;&nbsp;&nbsp;&nbsp;经营模式：<?=$m_row['c_type']?></li>
                       <li>&nbsp;&nbsp;&nbsp;&nbsp;会员等级：<?php if($m_row['m_type']==6){?><img src="/images/member.gif" border="0" align="absmiddle" /><?php }else{echo "普通会员";}?></li><br />
<br />
                  </ul>
               </div>
       <?php }else{?>
               <div class="rightmain topside6 rightside6 downside6">
                  <div id="login_right">
                      <div class="loginbox topside6">
                         <div class="size16 checkcode downside">
                             <p>您现在是普通会员，本信息对钻石会员开放，普通会员查看该信息需要<font color="#FF0000">2</font>个三帝币。</p>
                             <p>会员账号：<?=$mrow[m_user]?></p>
                             <p>三帝币：<?=$mrow[m_jifen]?>个&nbsp;&nbsp;<a href="/member/pay.php">充值</a></p>
                             <p>会员等级：普通会员</p>
                             <p align="center"><form method="post" action="" onsubmit="return checkjifen()"><input type="hidden" name="jifen" value="<?=$mrow[m_jifen]?>"/><input type="image" src="/images/jfliulan.gif" /></form></p>
							 <script language="javascript">
							    function $(id){
								   return document.getElementById(id);
								}
							    function checkjifen(){
								   if($("jifen").value<2){
								    alert("您的三帝币已经不足，请充值");
									return false;
								   }
								}
							 </script>
                         </div>
                      </div>
                  </div>
               </div>
       <?php }?>
<?php }else{?>
<script language="javascript">
function $(id){
   return document.getElementById(id);
}
function checklogin(){
   if($("logUserName").value==""){
   alert("用户名不能为空");
   $("logUserName").focus();
   return false;
   }
   if($("logPassword").value==""){
   alert("密码不能为空");
   $("logPassword").focus();
   return false;
   }
   if($("c_code").value==""){
   alert("验证码不能为空");
   $("c_code").focus();
   return false;
   }
}
function test(img){
    var src=img.getAttribute("src");
    src=src+"?new="+Math.random(0,10);
    img.setAttribute("src",src);
}
function prepare(){
    var nav=document.getElementById("test");
    var name=nav.getAttribute("name");
    var str="test";
    if(name==str){
        nav.onclick=function(){
            var img=document.getElementById("img");
            test(img);
            return false;
        }
    }
}
window.onload=prepare;
</script>
<div class="rightmain topside6 rightside6 downside6">
<div id="login_right">
<div class="loginbox topside6">
	<div class="size16 b checkcode downside">登录查看联系方式：</div>
		<form method="post" action="/login.php" onsubmit="return checklogin()">
		  <div class='loginbox topside6'>
			<div>
			   <span  class='leftinput'>用户名</span>
			   <span><input id='logUserName' name="logUserName" size="12" class="login_text" type="text" /></span>
			</div>
			<div>
			   <span class='leftinput'>密&nbsp;&nbsp;&nbsp;&nbsp;码</span>
			   <span><input class="login_text" type="password" name="logPassword" size="12" id='logPassword' /></span>
			</div>
			<div>
			   <span class='leftinput'>验证码</span>
			   <span><input name="c_code" type="text" id='code' size="4" maxlength="6" />
			   </span>
			   <span><img src="/inc/chk_num.php" name="img" align="absmiddle" id="img"/></span><a href="#" name="test" id="test">看不清？</a>
			</div>
			<div class="sigbutt"><input name="submit1" value="登 录" type="submit" id="submitbtn"/></div>
		</div>
	</form>
<div class="regtext size16 b" style="height:45px;line-height:45px;">您还不是会员，<a href="/join">免费注册</a></div>
</div>
</div>
</div>
<?php }?>
<div class="rightmain topside6 rightside6 downside6">
<script type="text/javascript"><!--
google_ad_client = "pub-2924453545159453";
/* 250x250, 创建于 11-3-18 */
google_ad_slot = "0029223338";
google_ad_width = 250;
google_ad_height = 250;
//-->
</script>
<script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script>
</div>
<div class="onl"></div>

</div>
<div id="mian"></div>

<div id="mian" class="topside6 side">
<script type="text/javascript">/*960*90，创建于2011-3-9*/ var cpro_id = 'u403357';</script><script src="http://cpro.baidu.com/cpro/ui/c.js" type="text/javascript"></script>
<div class="onl"></div>
</div>

<div id="mian" class="topside6 sideblue">
<div class="title3 size12"><span>更多求购产品</span>
  <div class="onl"></div>
</div>
<div class="company">
<ul>
<?php
$p_rs=@mysql_query("select id,picture,b_title from buy where b_sh=1 order by id desc limit 6");
while($p_row=@mysql_fetch_array($p_rs)){
?>
<li><a href="<?=$p_row['id']?>.html">
<?php if($p_row[picture]){?>
<img src="/upfile/<?=$p_row['picture']?>" width="120" height="125" border="0" />
<?php }else{?>
<img src="/images/prono88.gif" width="120" height="125" border="0" />
<?php }?>
</a>
<span><a href="<?=$p_row['id']?>.html"><?=mb_substr($p_row[b_title],0,10,'utf-8')?></a></span></li>
<?php }?>

</ul>
<div class="onl"></div>
</div>
<div class="onl"></div>
</div>
<div id="mian" class="topside6">
<div class="content size14">
免责声明:以上信息由企业自行提供，该企业负责信息内容的真实性、准确性和合法性，三帝贸易网对此不承担任何责任。
<br />
友情提示:为保障您的利益，建议优先选择钻石会员。</div>
</div>
<div class="w960 topside20 downside20 side">
<script type="text/javascript">/*960*90，创建于2011-3-9*/ var cpro_id = 'u403357';</script><script src="http://cpro.baidu.com/cpro/ui/c.js" type="text/javascript"></script>
<div class="onl"></div>
</div>
<?php include("../inc/foot.php");?>
</BODY>
</HTML>

<script type="text/javascript">/*120*270，创建于2010-12-18*/ var cpro_id = 'u319758';</script><script src="http://cpro.baidu.com/cpro/ui/f.js" type="text/javascript"></script>
<script Language="javascript">
   
   function imgToSize(oBool) {
     var oImg = document.all('oImg');
     oImg.style.zoom = parseInt(oImg.style.zoom) + (oBool ? 30 : -30) + '%';
   }

   var oArcSize = 1;
   function imgRoll() {
     var oImg = document.all('oImg');
     oImg.style.filter = 'Progid:DXImageTransform.Microsoft.BasicImage(Rotation='+ oArcSize +')';
     oArcSize += 1;
     oArcSize = oArcSize==4 ? 0 : oArcSize ;
   }

   function imgReverse(arg) {
     var oImg = document.all('oImg');
     oImg.style.filter = 'Flip' + arg;          
   }
   
   var oBoolean = false, oLeftSpace = 0, oTopSpace = 0;
   function mStart() {
      oBoolean = true;
      if (oBoolean) {
         var oImg = document.all('oImg');
         oLeftSpace = window.event.clientX - oImg.style.pixelLeft;
         oTopSpace = window.event.clientY - oImg.style.pixelTop;
      }
   }

   function mEnd() {
      oBoolean = false;
   }

   function document.onmousemove() {
      if (window.event.button==1 && oBoolean) {
         var oImg = document.all('oImg');
         oImg.style.pixelLeft = window.event.clientX - oLeftSpace;
         oImg.style.pixelTop = window.event.clientY - oTopSpace;
         return false;
      }
   }
</script>